package com.api.API.CodeLab.CodeIdeManager;

import com.api.POJO.CodeLab.CodeIde.CodeIdeReturnMsg;
import com.api.POJO.CodeLab.CodeIdeManager.CodeIdeAccount;
import com.api.POJO.CodeLab.CodeIdeManager.CodeIdeManagerReturnMsg;
import com.api.POJO.CodeLab.CodeIdeManager.CodeIdeUserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Description :CodeIde信息管理模块API
 * @Author :崔昌赫
 * @Date : 2021/10/26
 */
@FeignClient("CodeIdeManager")
public interface CodeIdeManagerAPI {

    @PostMapping("/users/codelab/codeide/password")
    CodeIdeManagerReturnMsg setCodeIdePassword(@RequestBody CodeIdeAccount account);

    @PostMapping("/users/codelab/codeide/userinfo")
    CodeIdeManagerReturnMsg setCodeIdeUserInfo(@RequestBody CodeIdeUserInfo info);

    @GetMapping("/users/codelab/codeide/password/uid/{uid}")
    CodeIdeManagerReturnMsg getCodeIdePassword(@PathVariable String uid);

    @GetMapping("/users/codelab/codeide/info/uid/{uid}")
    CodeIdeManagerReturnMsg getCodeIdeInfo(@PathVariable String uid);

    @GetMapping("/codelab/getnode/{node}")
    String getNodeIp(@PathVariable String node);

    @GetMapping("/codelab/codeide/getport")
    List<String> getAllPorts();
}
